package org.example.service.imp;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.example.bean.StaffBean;
import org.example.mapper.IStaffMapper;
import org.example.service.IStaffService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class StaffServiceImp implements IStaffService {
    @Autowired
    private IStaffMapper mapper;
    @Override
    public StaffBean login(String userName, String password) {
        return mapper.login(userName, password);
    }

    @Override
    public PageInfo<StaffBean> cutFindByItem(Integer pageNum, String realName, String dept) {
        PageHelper.startPage(pageNum,3);
        PageInfo<StaffBean> pg = PageInfo.of(mapper.cutFindByItem(realName,dept));
        return pg;
    }
}
